#ifndef ENTITYOBJECT_H
#define ENTITYOBJECT_H

#include <core/entity.h>

#include <QtScript>
#include <qsharedpointer.h>

namespace Opl
{
    namespace Core
    {

        /*!
         \brief
         Class contain feauters QObject and Entity, also is base object for all declarative scripts

         \sa Entity
        */
        class CORE_EXPORT EntityObject : public QObject, public Entity
        {
                Q_OBJECT
                Q_PROPERTY(QVariant tag READ tag WRITE setTag)
                Q_PROPERTY(uint unique READ unique)
                Q_PROPERTY(QDateTime unique READ stamp)
            public:
                static QString ID;
                /*!
                 \brief

                 \return QString reprezentatnion current EntityObject as QString
                */
                virtual QString toString();


                EntityObject(EntityObject* parent = 0);
                virtual ~EntityObject();

                static void fromScriptValue(const QScriptValue& object, EntityObject*& out);
                static QScriptValue toScriptValue(QScriptEngine* engine, EntityObject* const& in);
                static QScriptValue construct_Script(QScriptContext*, QScriptEngine* engine);

            private:
        };

        typedef QSharedPointer<EntityObject> EntityPtr;

    }
}

Q_DECLARE_METATYPE(Opl::Core::EntityObject*)
#endif // ENTITYOBJECT_H
